﻿using System;
using System.Windows.Data;
using Informant.Contacts;

namespace Informant.Clients.UI.Wpf4.Converters
{
	public class ContactNameConverter : IValueConverter
	{
		public Object Convert(Object value, Type targetType, Object parameter, System.Globalization.CultureInfo culture)
		{
			Object result = Binding.DoNothing;

			IContact contact = value as IContact;
			if (contact != null)
			{
				result = String.Concat(contact.FirstName, " ", contact.LastName);
			}
			return result;
		}
		public Object ConvertBack(Object value, Type targetType, Object parameter, System.Globalization.CultureInfo culture)
		{
			throw new NotImplementedException();
		}
	}
}
